#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;


int mod(string s,string s2)
{
	int tmp = 0;
	int c = stoi(s2);
	int size = s.size();
	for (int i = 0; i < size; i++)
	{
		tmp *= 10;
		tmp += s[i] - '0';
		if (tmp >= c)
		{
			tmp %= c;

		}
	}

	return tmp;

}


int main()
{
	string s = "12345678901234567890123456789012345678901234567890";
	cout << mod(s,"2023") << endl;
	return 0;
}